/*
    This file is part of Slydini.

    Slydini is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Slydini is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Slydini.  If not, see <http://www.gnu.org/licenses/>.
*/
#include <QWidget>
#include <QPoint>
#include <QImage>
#include <QPainter>
#include <stdlib.h>
#include "../gui/left_menu.h"
#include "../gui/up_menu.h"
#include "../gui/down_menu.h"
#include "../gui/right_menu.h"

class SWidget : public QWidget
{

	public:
		SWidget(int a, int b, QWidget *parent);
		~SWidget();
        void setImage(QImage *img) { image = img;};
        QImage* getImage() { return image;};
        enum Pen { simple, spray, symetric, ribbon1, ribbon2, circles, images };
        static Pen   penStyle;
        static QColor color;
        static int penSize;
        static int step;
        static int penWidth;
        static int menu;
        static int imageNo;
  	    LeftMenu *lmenu;
        UpMenu *umenu;
        RightMenu *rmenu;
        DownMenu *dmenu;
       

	protected:
        void clear();
		void paintEvent(QPaintEvent*);
		void mouseMoveEvent (QMouseEvent* event);
		void mousePressEvent(QMouseEvent* event);
        void mouseReleaseEvent(QMouseEvent* event);
        void drawSPoint(const QPoint &pnt);
        void drawLineTo(const QPoint &pnt);
        void drawMyLine(const QPoint &pnt1, const QPoint &pnt2);


    private:
        QPoint *sPoint;
        QPoint *firstPoint; // for symetric penStyle
        QImage *image;
        QImage *forpen1a;
        QImage *forpen1b;
        QImage *forpen1c;
        QImage *forpen2a;
        QImage *forpen2b;
        QImage *forpen2c;
        QImage *forpen3a;
        QImage *forpen3b;
        QImage *forpen3c;
        QPen   *pen;
        bool    line;


        
};
